package com.daiyang.campus_lucky_draw.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ActivityStatusEnum {
    RUNNING(1, "进⾏中"),
    COMPLETED(2, "已完成");
    /**
     * 状态码
     */
    private final Integer code;
    /**
     * 描述
     */
    private final String message;
    public static ActivityStatusEnum fromName(String name) {
        for (ActivityStatusEnum activityStatus : ActivityStatusEnum.values()) {
            if (activityStatus.name().equalsIgnoreCase(name)) {
                return activityStatus;
            }
        }
        throw new IllegalArgumentException("Invalid name: " + name);
    }
}
